puts "Enter a, b, c (a#0):"
a=gets.to_f
b=gets.to_f
c=gets.to_f
if a==0
  puts "a is equal to 0"
else
  delta=(b*b)-4*a*c
  if delta<0
    delta*=-1;
    r = (-b/(2*a))
    i = ((Math.sqrt(delta))/(2*a)).abs
    printf("x1 = %0.0004f +  %0.0004fi\n",r, i)
    printf("x2 = %0.0004f -  %0.0004fi\n",r, i)
  elsif delta==0
    puts "x1=x2=#{-b/(2*a)}"
  else
    x1=((-b+Math.sqrt(delta))/(2*a))
    x2=((-b-Math.sqrt(delta))/(2*a))
    printf("x1 = %0.0004f \n",x1)
    printf("x2 = %0.0004f \n",x2)
  end
end